# Maintainer: Sven-Hendrik Haase <svenstaro@archlinux.org>
# Contributor: Nicola Squartini <tensor5@gmail.com>

pkgname=asar
pkgver=3.2.4
pkgrel=1
pkgdesc='Creating Electron app packages'
arch=('any')
url='https://github.com/electron/asar'
license=('MIT')
depends=('nodejs')
makedepends=('npm')
options=(!emptydirs)
noextract=("${_pkgname}-${pkgver}.tgz")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/electron/asar/archive/refs/tags/v${pkgver}.tar.gz")
sha512sums=('5d7c8bcdb4ea4c596fe85a1912a05d8ddf54ea76877a0386efc73f46401fb5d8b71921a3844f82828fbd48dfc4cec1d835b80597fe6ca27f397b023302a1aa77')

package() {
    npm install -g --prefix "${pkgdir}/usr" "${srcdir}/${pkgname}-${pkgver}.tar.gz"
    chown -R root:root "${pkgdir}"

    install -Dm644 "${pkgdir}/usr/lib/node_modules/@electron/asar/LICENSE.md" "${pkgdir}/usr/share/licenses/asar/LICENSE.md"
}
